package com.example.demo.service;

import com.example.demo.domain.User;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
@Component
public interface UserService {
    /**
     * 登录功能
     * @param username
     * @param pwd
     * @return
     */
    User login(String username, String pwd);

    /**
     * 注册功能
     * @param user
     * @return
     */
    boolean register(User user);

    /**
     * 根据id查找用户
     * @param id
     * @return
     */
    User findUserById(Integer id);

    /**
     * 根据id查找用户
     * @param user
     * @return
     */
    boolean revise(User user);

    /**
     * 判断用户是否存在
     * @param id
     * @param oldPwd
     * @return
     */
    User findByUserByPwd(int id, String oldPwd);

}
